package svr

import (
	"bufio"
	"net"
)

type BufferedConn struct {
	bufio.Reader
	net.Conn
}

func NwBufferedConn(c net.Conn) BufferedConn {
	return BufferedConn{ *bufio.NewReader(c),c}
}

func NewBufferedConnSize(c net.Conn, n int) BufferedConn {
	return BufferedConn{ *bufio.NewReaderSize(c, n),c}
}

func (b BufferedConn) Peek(n int) ([]byte, error) {
	return b.Reader.Peek(n)
}

func (b BufferedConn) Read(p []byte) (int, error) {
	return b.Reader.Read(p)
}

type MuxListener struct {

}